package com.hut.oa.model.dao.workreport;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.hut.oa.model.bean.WorkReport;

public interface WorkReportDao extends PagingAndSortingRepository<WorkReport, Long>{
	
	@Query("from WorkReport wr where wr.userId=?1 and wr.type=?2 and wr.time = ?3 and wr.year=?4")
	WorkReport findRead(Long userid,String type,Integer time,Integer year);
	
	@Query("from WorkReport wr where wr.userId=?1 and wr.type=?2 and wr.year=?3 and wr.release=?4")
	List<WorkReport> findReads(Long userid,String type,Integer year,Integer release);
	
	
	
}
